﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DMS.Base;

namespace DMS.Business.Utility
{
    public class CommonHelper
    {
        /// <summary>
        /// 获取几天之后的工作日
        /// 比如，开始日期是周一，3天之后就是周四
        /// </summary>
        /// <param name="start">开始日期</param>
        /// <param name="daysAfter">几天之后</param>
        /// <returns></returns>
        public static DateTime GetWorkDate(DateTime start,int daysAfter)
        {
            for (int i = 0; i < daysAfter; i++)
            {
                if (start.DayOfWeek == DayOfWeek.Friday)
                    start = start.AddDays(3);
                else if (start.DayOfWeek == DayOfWeek.Saturday)
                    start = start.AddDays(2);
                else
                    start = start.AddDays(1);
            }
            return start;
        }

    }
}
